<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>tiles-server</title>
    <link rel="stylesheet" href="http://cdn.staticfile.org/leaflet/1.5.1/leaflet.css">
    <style>
        html,body {
            padding: 0;
            margin: 0 auto;
            width: 100%;
            height: 100%;
            min-width: 100%;
        }
        #map {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
<div id="map"></div>
<script src="http://cdn.staticfile.org/leaflet/1.5.1/leaflet.js"></script>
<script>
    var map = L.map('map',{
        center: [22.64201285833866, 114.02572999825531],
        zoom: 18,
        zoomControl: false,
        attributionControl: false,
    });
    var layer = L.tileLayer();
    layer.getTileUrl = function(coords)
    {
        var z = coords.z;
        var x = coords.x;
        var y = coords.y;
        y = (2**z-1)-y;
        return 'http://localhost:3000/mbtiles/test/'+z+'/'+x+'/'+y+'.png';
    };
    layer.addTo(map);
</script>
</body>
</html>